﻿using ApprovalTests;
using ApprovalTests.Reporters;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using Registration.Twitter;

namespace TestProject1
{
    [TestClass]
    [UseReporter(typeof(DiffReporter))]
    public class UnitTest1
    {
        private const string File = @"C:\Users\Llewellyn\Desktop\Lynn\search.json";

        [TestMethod]
        public void TestMethodAuthor()
        {
            var tweets = TwitterParser.LoadFile(File);
            var enumerable = tweets.Item2.OrderBy(a => a.Author1).ToArray();
            Approvals.Approve(enumerable, "author");
        }
        [TestMethod]
        public void TestMethodTweets()
        {
            var tweets = TwitterParser.LoadFile(File);
            var all = tweets.Item1.OrderBy(t => t.DateTime).ToArray();
            Approvals.Approve(all, "tweet");
        }
        [TestMethod]
        public void TestMentions()
        {
            var tweets = TwitterParser.LoadFile(File);
            var all = tweets.Item3;
            Approvals.Approve(all, "Mentions");
        }

        [TestMethod]
        public void TestCreateDatabase()
        {
            TwitterLoader.CleanDatabase();
            TwitterLoader.LoadIntoDatabaseFromTwitter("SQLPass");
        }

        
    }
}
